package com.example.basemvp.login;

import com.example.basemvp.base.BasePresenter;
import com.example.basemvp.bean.UserBean;
import com.example.basemvp.login.loginContract.LoginContract;

public class LoginPresenter extends BasePresenter<LoginActivity, LoginModel, LoginContract.Presenter> {

    @Override
    protected LoginModel getModel() {
        return new LoginModel(this);
    }

    @Override
    protected LoginContract.Presenter<UserBean> getContract() {
        return new LoginContract.Presenter<UserBean>() {
            @Override
            public void requestLogin(String username, String pwd) {
                model.getContract().execueLogin(username, pwd);
            }

            @Override
            public void responesLogin(UserBean data) {
                getView().getContract().handeLogin(data);
            }
        };
    }
}
